package com.bang.itstack.day01;

import com.bang.itstack.day01.impl.CardCommodityService;
import com.bang.itstack.day01.impl.CouponCommodityService;
import com.bang.itstack.day01.impl.GoodsCommodityService;

/**
 * @ClassName: StoreFactory
 * @Desc: TODO
 * @author: <Bang>
 * @Date: 2021/10/20 21:16
 * @Version: 1.0
 * @Modified By:
 */
public class StoreFactory {

    public ICommodity getCommodityService(Integer commodityType) {
        if (null == commodityType) return null;
        if (1 == commodityType) return new CouponCommodityService();
        if (2 == commodityType) return new GoodsCommodityService();
        if (3 == commodityType) return new CardCommodityService();
        throw new RuntimeException("不存在的商品服务类型");


    }
}
